#include<iostream>
#include"namesp.h"

namespace pers
{
	using std::cout;
	using std::cin;
	void getPersion(Person &rp)
	{
		cout << "Enter first name:";
		cin >> rp.fname;
		cout << "Enter last name:";
		cin >> rp.lname;
	}

	void showPerson(const Person &rp)
	{
		std::cout << rp.fname << "  " << rp.lname << std::endl;
	}

}



namespace debts
{
	void getDebt(Debt &rd)
	{
		getPerson(rd.name);
		std::cout << "enter debe:";
		std::cin >> rd.amount;
	}

	void showDebt(const Debt &rd)
	{
		showPerson(rd.name);
		std::cout << rd.amount << std::endl;
	}

	double sumDebts(const Debt ar[], int n)
	{
		double totle = 0;
		for (int i = 0; i < n; i++)
		{
			totle += ar[i].amount;
		}
		return totle;
	}

}